{include file="layout/header" title="编辑学生" /}
{include file="layout/sidebar" /}
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            学生管理
            <small>编辑学生</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 学生管理</a></li>
            <li class="active">编辑学生</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <script src="__PLUGIN__/bootstrapvalidator/js/bootstrapValidator.min.js"></script>
        <link rel="stylesheet" href="__PLUGIN__/bootstrapvalidator/css/bootstrapValidator.min.css">
        <script src="__PLUGIN__/iCheck/icheck.min.js"></script>
        <link rel="stylesheet" href="__PLUGIN__/iCheck/all.css">
        <!-- Horizontal Form -->
        <div class="box box-info" style="width:90%;margin: 0 auto;">
            <div class="box-header with-border">
                <h3 class="box-title">学生参数</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" action="" method="post">
                <div class="box-body">
                    <div class="form-group">
                        <label for="school_id" class="col-sm-2 control-label">校区</label>
                        <div class="col-sm-10">
                            <input type="hidden" name="stu_id" value="{$student.stu_id}" />
                            <input type="text" class="form-control" id="school_id" name="school_id" value="{$student.school_id}" placeholder="校区">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="grade" class="col-sm-2 control-label">年级</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="grade" name="grade" value="{$student.grade}" placeholder="年级">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="class" class="col-sm-2 control-label">班级</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="class" name="class" value="{$student.class}" placeholder="班级">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="stu_no" class="col-sm-2 control-label">学号</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="stu_no" name="stu_no" value="{$student.stu_no}" placeholder="学号">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="stu_name" class="col-sm-2 control-label">姓名</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="stu_name" name="stu_name" value="{$student.stu_name}" placeholder="姓名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="gender" class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-10">
                            <label>
                                <input type="radio" name="gender" value="0" class="minimal" {eq name="$student.gender" value="0"}checked{/eq}> 男
                            </label>
                            <label>
                                <input type="radio" name="gender" value="1" class="minimal" {$student.gender =='1' ? 'checked':''}> 女
                            </label>                            
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="stu_password" class="col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="stu_password" name="stu_password" value="{$student.stu_password}" placeholder="密码">
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <input type="hidden" name="__token__" value="{$Request.token}" />
                    <button type="reset" class="btn btn-default">重置</button>
                    <!--<a href="/admin/student/list?page={$page}" class="btn btn-default">返回</a>-->
                    <button type="submit" class="btn btn-info pull-right">提交</button>
                </div>
                <!-- /.box-footer -->
            </form>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script type="text/javascript">
    //jQuery代码
    $(function () {
        //iCheck for checkbox and radio inputs
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        //bootstrapValidator
        $('form').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                grade: {
                    message: '数据名验证失败',
                    validators: {
                        notEmpty: {
                            message: '年级不能为空'
                        },
                        digits:{
                            message: '年级必须填数字'
                        }
                    }
                },
                class: {
                    validators: {
                        notEmpty: {
                            message: '班级不能为空'
                        },
                        digits:{
                            message: '班级必须填数字'
                        }
                    }
                },
                stu_no: {
                    validators: {
                        notEmpty: {
                            message: '学号不能为空'
                        }
                    }
                },
                stu_name: {
                    validators: {
                        notEmpty: {
                            message: '姓名不能为空'
                        }
                    }
                },
                gender: {
                    validators: {
                        notEmpty: {
                            message: '性别不能为空'
                        }
                    }
                },
                stu_password: {
                    validators: {
                        notEmpty: {
                            message: '密码不能为空'
                        }
                    }
                }
            }
        });
    });
</script>
{include file="layout/footer" /}